// 接口  interface
interface Person {
    name: string,
    color:string
}
//继承
interface Person1 extends Person{
    height:number
}
let p :Person  = {
    name:'1',
    color:'123'
}
console.log(p)
let p1:Person1 ={
    name:'10',
    color:'3321',
    height:100
}
console.log(p1)

//可选属性  ？
interface Params {
    login:string,
    code:string,
    mobile?:string,
    nickname?:string
}
let data:Params={
    login:"string",
    code:"string",
    mobile:"string",
}

//类型断言
function  getLength(n:(number | string|number[])){
    return (<number[]>n).length
}

console.log(getLength(1))

//枚举  enum
enum Sta {
    "可约" = 1,
    "已满" = 2,
    "休息" = 3
}
let  data1 = {
    code:0,
    data:{
        start :1
    }
}
console.log(data1.data.start)

//any
let aa:any =111
aa=11
aa='ss'